import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {UserService} from "../../providers/UserService";
import {USERFACE_PATH} from "../../providers/Constants";

@IonicPage()
@Component({
  selector: 'page-join-sport-person',
  templateUrl: 'join-sport-person.html',
})
export class JoinSportPersonPage {

  sportId:any;
  userList:any;
  userFacePath:string;

  constructor(public navCtrl: NavController,
              public navParams: NavParams,
              public  userService:UserService) {

    this.userFacePath = USERFACE_PATH;

  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad JoinSportPersonPage');
    this.sportId = this.navParams.get("sportId");
    this.getJoinSportUserList(this.sportId);
  }

  getJoinSportUserList(sportId){
    this.userService.selectJoinSportPerson(sportId).subscribe(res=>{
      this.userList = res["data"];
    })
  }

}
